// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   Globals.java

package com.vandagroup.common.db;

import java.io.PrintStream;
import java.util.*;

public final class Globals
{

    private static Map cache;

    public Globals()
    {
    }

    public static String getValue(String key)
    {
        String value = (String)cache.get(key);
        if(value != null)
            value = value.trim();
        return value;
    }

    public static int getIntValue(String key)
    {
        String value = getValue(key);
        int nValue = 0;
        try
        {
            nValue = Integer.parseInt(value);
        }
        catch(Exception exception) { }
        return nValue;
    }

    public static void main(String args[])
    {
        System.out.println(getValue("portal.pooled"));
    }

    static 
    {
        cache = null;
        try
        {
            ResourceBundle resources = ResourceBundle.getBundle("com.vandagroup.common.resources.db");
            Enumeration enuKey = resources.getKeys();
            cache = Collections.synchronizedMap(new HashMap());
            String strKey;
            String strValue;
            for(; enuKey.hasMoreElements(); cache.put(strKey.trim().toLowerCase(), strValue))
            {
                strKey = (String)enuKey.nextElement();
                strValue = resources.getString(strKey);
                int index = strValue.indexOf("#");
                if(index != -1)
                    strValue = strValue.substring(0, index).trim();
            }

        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
}
